using UnityEngine;
using System.Collections;

public class _Victory5 : MonoBehaviour {

	public static bool stop = false;
	Vector2 realS;
	
	void Start () 
	{
		gameObject.AddComponent("BoxCollider");

		
		realS.x = 2 * Menu.ns.x;
		realS.y = 50 * Menu.ns.y;		
		this.gameObject.transform.position = new Vector3(transform.position.x * Menu.ns.x , realS.y , 0);
		gameObject.GetComponent<BoxCollider>().size = new Vector3(realS.x , realS.y , 0);
		
		stop = false;
	}
	
	void Update () 
	{
		if(transform.position.x <= 17)
			stop = true;
		
		else 
			transform.Translate(_Speed.speed , 0 , 0);
			
		
	}
	
	void OnCollisionEnter(Collision c)
	{
		if(c.gameObject.name == "Player")
		{
			Application.LoadLevel("SelecaoCenas");
			if(selecaoCenas.kid != 4)
			{
				bancoDeDados.Save(2);
			}
		}
	}
}
